package com.pxst.merchant.controller;

import com.pxst.merchant.req.MerchantAccountListReq;
import com.pxst.merchant.req.MerchantAccountReq;
import com.pxst.merchant.resp.MerchantAccountResp;
import com.pxst.merchant.service.SysMerchantBankCardService;
import com.pxst.merchant.service.impl.SysMerchantBankCardServiceImpl;
import com.pxst.resp.ApiResp;
import com.pxst.resp.PageResp;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * @Author: @Ryan
 * @Description:
 * @CreateTime: 2023-09-14 15:03
 */
@RestController
@Api(tags = "商户账户相关接口")
@RequestMapping("api/sh120")
public class SysMerchantBankCardController {
    @Autowired
    private SysMerchantBankCardService sysMerchantBankCardService;

    @GetMapping("/list")
    @ApiOperation("根据条件获取商户账户列表")
    public ApiResp<PageResp<MerchantAccountResp>> getMerchantAccountByCondition(MerchantAccountListReq conditions){
        return sysMerchantBankCardService.getMerchantAccountListByCondietions(conditions);
    }

    @PutMapping("/update")
    @ApiOperation("更新商户银行账户状态")
    public ApiResp updateMerchantBankCardStatus(@RequestBody MerchantAccountReq merchantAccountReq){
        return sysMerchantBankCardService.updateMerchantBankCardStatus(merchantAccountReq);
    }
}
